System.register(["./application.js"], function (_export, _context) {
  "use strict";

  var Application, canvas, $p, bcr, application;

  function topLevelImport(url) {
    return System["import"](url);
  }

  return {
    setters: [function (_applicationJs) {
      Application = _applicationJs.Application;
    }],
   
    execute: function () {
    
      canvas = document.getElementById('GameCanvas');
      $p = canvas.parentElement;
      bcr = $p.getBoundingClientRect();
      canvas.width = bcr.width;
      canvas.height = bcr.height;
      application = new Application();
     //游戏进度条控制
      function incrementCounter() {
        updateProgress();
      }

      let progress = 5;
     function updateProgress() {
        if (progress >= 100) {
         // document.querySelector('.loading-container').style.display = 'none';
            return;
        }
        progress += 1; // Increment by 10%
        var progressBarFill = document.getElementById('progress-bar-fill');
        progressBarFill.style.width = (progress).toFixed(2) + '%';
    }

      // 设置定时任务，每秒执行一次incrementCounter函数
      setInterval(incrementCounter, 100);
      
      topLevelImport('cc').then(function (engine) {
        return application.init(engine);
      }).then(function () {
        return application.start();

      })["catch"](function (err) {
        console.error(err);
      });
    }
  };
});